"""
base64
b64encode() ---> 二进制数据转换BASE64编码
b64decode() ---> BASE64编码还原二进制数据
"""
import base64

import requests

resp = requests.get('http://localhost:8000/')
result = resp.json()
data = base64.b64decode(result['picture'])
with open('haha.jpg', 'wb') as file:
    file.write(data)
